/* eslint-disable */
const ua = process.browser? window.navigator.userAgent:'';

const isWeixin = /MicroMessenger/i.test(ua);
const isAndroid = /Android/i.test(ua);
const isIphone = /iPhone/i.test(ua);
const isJeTiao = /qfinan/i.test(ua); // 借条

// iphoneX iphoneXS 刘海高度 30px
const isIphoneX = !!(isIphone && window.devicePixelRatio && window.devicePixelRatio === 3 && window.screen.width === 375 && window.screen.height === 812);

// 刘海高度： 44px
const isIphoneXSMAX = !!(isIphone && window.devicePixelRatio && window.devicePixelRatio === 3 && window.screen.width === 414 && window.screen.height === 896);

// 刘海高度 33px
const isIphoneXR = !!(isIphone && window.devicePixelRatio && window.devicePixelRatio === 2 && window.screen.width === 414 && window.screen.height === 896);

// iphone12 iphone12 pro
const isIphone12 = !!(isIphone && window.devicePixelRatio && window.devicePixelRatio === 3 && window.screen.width === 390 && window.screen.height === 844);

const isIphone12MAX = !!(isIphone && window.devicePixelRatio && window.devicePixelRatio === 3 && window.screen.width === 428 && window.screen.height === 926);

// iPhoneX版本以上的刘海屏
const isIphoneXup = isIphoneX || isIphoneXSMAX || isIphoneXR || isIphone12 || isIphone12MAX;

export default {
  isWeixin,
  isAndroid,
  isIphone,
  isIphoneX,
  isIphoneXSMAX,
  isIphoneXR,
  isIphoneXup,
  isJeTiao,
  isIphone12,
  isIphone12MAX
}
